package com.github.sbb.sherry.primitives.rules.flow;

import com.github.sbb.sherry.primitives.api.RuleListener;
import com.github.sbb.sherry.primitives.api.RulesEngineListener;
import com.github.sbb.sherry.primitives.core.AbstractRulesEngine;
import com.github.sbb.sherry.primitives.rules.FlowRuleTypeEnum;
import java.util.List;
import java.util.Map;

public class FlowRulesEngine extends AbstractRulesEngine {

  private final FlowRules rules;

  public FlowRulesEngine(FlowRules rules, List<RuleListener> ruleListeners,
      List<RulesEngineListener> rulesEngineListeners) {
    super(ruleListeners, rulesEngineListeners);
    this.rules = rules;
  }

  @Override
  public void fire(Map<String, Object> params) {
    FlowRule startRule = rules.getStartRule();
    if (startRule.getType() == FlowRuleTypeEnum.PROCESS_START) {
      // 开始节点，直接获取它的所有分支节点
    } else if (startRule.getType() == FlowRuleTypeEnum.PROCESS_END) {
      // 结束节点，可以返回了
    }

  }
}
